
#ifndef __VIDEO_WIDGET_H_
#define __VIDEO_WIDGET_H_

#include <vlcmm/videoarea.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <vlc/vlc.h>
#include <vlc_interface.h>
#include <vlc_vout.h>

#include "gtkmm.hh"

class VideoWidget
{

public:

  VideoWidget (intf_thread_t*);
  virtual ~VideoWidget ();

  void* request (vout_thread_t *, int *, int *, unsigned int *, unsigned int *);
  int   control (void *, int, va_list);
  void  release (void *);

  Vlc::VideoArea m_area;

private:

  bool button_press_event (GdkEventButton* event);

  Glib::RefPtr<Gdk::Pixbuf> pixbuf;

  intf_thread_t *p_intf;
  vout_thread_t *p_vout;
  vlc_mutex_t lock;

};

static void *DoRequest (intf_thread_t *, vout_thread_t *, int *,int *, unsigned int *, unsigned int *);
static int  DoControl (intf_thread_t *p_intf, void *p_win, int i_q, va_list a);
static void DoRelease  (intf_thread_t *, void *);

static void*
DoRequest (intf_thread_t *p_intf, vout_thread_t *p_vout, int *pi0, int *pi1, unsigned int *pi2, unsigned int *pi3)
{

  return p_intf->p_sys->p_video->request (p_vout, pi0, pi1, pi2, pi3);

}

static int
DoControl (intf_thread_t *p_intf, void *p_win, int i_q, va_list a)
{

  return p_intf->p_sys->p_video->control (p_win, i_q, a);

}

static void
DoRelease (intf_thread_t *p_intf, void *p_win)
{

  return p_intf->p_sys->p_video->release (p_win);

}

#endif /* __VIDEO_WIDGET_H_ */

